CSV file downloading blank when based on a slice

I have slice of a main table that is created using a user defined table so they csan search for different type of outlets int he data. It always downloads a blank csv file though with just column headings.

(I posted this previously and Steve asked me to post a screen shot of my table but I canโ€™t find that original post)

So here it is. thanks Phil

Solved Solved
0 10 1,127
1 ACCEPTED SOLUTION

The following seems to work:

I have created 4 new virtual columns (with temp names for the mo) and given each the following app formula

SELECT( Filterlist[Outlet Rating], [User Id] =USEREMAIL() )
SELECT( Filterlist[Price Band Name], [User Id] =USEREMAIL() )
SELECT( Filterlist[Postcode (letters)], [User Id] =USEREMAIL() )
SELECT( Filterlist[Outlet Type], [User Id] =USEREMAIL() )

I then changed the slice formula to the following

AND(
IN( [Outlet Rating], [New Virtual Column] ),
IN( [Price List], [New Virtual Column 1] ),
IN( [Spare], [New Virtual Column 2] ),
IN( [Outlet Type], [New Virtual Column 3] ))

The expression has been broken up using virtual columns which seems to have solved it.

Thanks

Phil

View solution in original post

10 REPLIES 10

Was this the other post?

I didnโ€™t see any contribution by Steve here so maybe there was another thread it was discussed?

I would like to see the Slice definition and the View from which you are trying to activate the CSV download from.

Hi John,

Below is the slice expression. Also are screenshots of the views. I have a gallery view that give the user 3 options for searching the main table with one being a โ€œPostcode deep searchโ€. That takes them to a view of the user defined table โ€œfilterlistโ€ where inputs are made. An action button takes the user to a view of the slice with expression below where outlets int he main table are shown if they have the right values in the correct columns.

AND(

IN( [Outlet Rating], SELECT( Filterlist[Outlet Rating], [User Id] =USEREMAIL() ) ),

IN( [Price List], SELECT( Filterlist[Price Band Name], [User Id] =USEREMAIL() ) ),

IN( [Spare], SELECT( Filterlist[Postcode (letters)], [User Id] =USEREMAIL() ) ),

IN( [Outlet Type], SELECT( Filterlist[Outlet Type], [User Id] =USEREMAIL() ) ))

I wonder if itโ€™s the Dashboard view thatโ€™s interfering? Try the download on the view based on the slice OUTSIDE of the dashboard.

I think this is a bug with dashboard views.

I copied the sample app you referred to in the original post. I changed the chart to a table and moved the view to the Menu list. I changed the dashboard to show only the Table view and turned on โ€œShow Overlay buttonsโ€ feature. I then added an action to download to CSV shown as overlay.

When I tap the button from the Dashboard view, I get a blank file - not even headers.

When I tap the button from the Table view in the Menu, I get a file with the expected headers and data.

I recommend opening this as a bug. Unfortunately, youโ€™ll need to find an alternative way to perform the CSV download.

Thanks John,

Even a staight menu view with no dashboard of the slice doesnโ€™t produce anything either.

Iโ€™ve had a play around and the CONTAINS expression works below - which is a part fix as some of the wrong rows will come up as fragmented parts of values will appear in others rather than exact matches.

Iโ€™m wondering if SPLIT(LIST might help?

AND(

CONTAINS( SELECT( Filterlist[Outlet Rating], [User Id] =USEREMAIL() ), [Outlet Rating]),

CONTAINS( SELECT( Filterlist[Price Band Name], [User Id] =USEREMAIL() ) ,[Price List] ),

CONTAINS( SELECT( Filterlist[Postcode (letters)], [User Id] =USEREMAIL() ) ,[Spare] ),

CONTAINS( SELECT( Filterlist[Outlet Type], [User Id] =USEREMAIL() ) ,[Outlet Type] ))

Hmm, if the view is showing data, the CSV download should simply copy and write them to file for download, no other magic involved. At that point, I wouldnโ€™t even think the expression for the Slice would come into play - but I donโ€™t know how AppSheet implemented it in the background.

Not sure what you have tried but here is what I would do in these circumstances. I would save to somewhere the current expression used in the Slice. Then I would remove the criteria altogether and retest the download. Slowly build up the expression, testing in between, until it stops working then investigate what you just added to see what could be causing issues.


One other note, CONTAINS(), even though it is working in this case, is not intended to work on Lists. It is meant to test if a substring is contained within another text string.

IN() is actually the correct function to use for your purposes.


If I get some time I may try to create something similar to your example based off of your expression to see if I can re-create a similar issue to what you are seeing.

The following seems to work:

I have created 4 new virtual columns (with temp names for the mo) and given each the following app formula

SELECT( Filterlist[Outlet Rating], [User Id] =USEREMAIL() )
SELECT( Filterlist[Price Band Name], [User Id] =USEREMAIL() )
SELECT( Filterlist[Postcode (letters)], [User Id] =USEREMAIL() )
SELECT( Filterlist[Outlet Type], [User Id] =USEREMAIL() )

I then changed the slice formula to the following

AND(
IN( [Outlet Rating], [New Virtual Column] ),
IN( [Price List], [New Virtual Column 1] ),
IN( [Spare], [New Virtual Column 2] ),
IN( [Outlet Type], [New Virtual Column 3] ))

The expression has been broken up using virtual columns which seems to have solved it.

Thanks

Phil

Awesome! So the CSV download is working now?

Yes,

Surpised I got that working so easily

Cheers

Had a similar issue an solved it like this:

IN ( [Tropa Nยฐ], SPLIT ( Filtro[Tropa], โ€œ,โ€ ))

SPLIT made the trick, now CSV isnโ€™t blank.

The whole Row filter condition of the slice looks like this:

AND (
IF ( ISNOTBLANK ( FILTRO[Fecha inicio]), [Fecha] >= ANY ( Filtro[Fecha inicio] ), TRUE),
IF ( ISNOTBLANK ( FILTRO[Fecha fin]), [Fecha] <= ANY ( Filtro[Fecha fin] ), TRUE),
IF ( ISNOTBLANK ( FILTRO[Tropa]), IN ( [Tropa Nยฐ], SPLIT ( Filtro[Tropa], โ€œ,โ€ )), TRUE),
IF ( ISNOTBLANK ( FILTRO[Sexo]), IN ( [Sexo], SPLIT ( Filtro[Sexo], โ€œ,โ€ )), TRUE),
IF ( ISNOTBLANK ( FILTRO[Categorรญa]), IN ( [Clasificaciรณn], SPLIT ( Filtro[Categorรญa], โ€œ,โ€ )), TRUE)
)

The problem was the way the IN function was getting the list generated by the enumlist fields.

Hope it heps!

Top Labels in this Space