Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can't seem to be able to use a date in a calculated dimension:
1) Load statement
date#(<Input String>,'DDMMYYYY') as ExportDate
2) Variables
SET lastExport = max({1} DateExport )
3) Calculated dimension in my chart
=if(DateExport=$(lastExport), Catégorie)
//This yields a msg "Error in calculated dimension"
=if(DateExport='$(lastExport)', Catégorie) //Notice the single quotes
//This yields no result (condition seems to be always wrong)
Help!
Is this a typo?
SET lastExport = max({1} DateExport )
max({1} ExportDate ) // right one
You cannot use set analysis in the script. And you cannot use an aggregation function in a Set or a Let statement.
HIC
Yes Typo when I created the case here, but no typo in my code.
load
date#(yourDateString,'DDMMYYYY') as ExportDate,
....
...
from your data source;
in the front end I assume you declared a variable
as lastExport = max({1} ExportDate)
in your calculated dimension
=if(ExportDate='$(lastExport)', Categorie)
=if(ExportDate=$(=lastExport), Categorie)
hth
Sasi
Hi hic, he is probably just writing an expression (a mere string to hold in a variable) at the back-end which is to be used at the front-end.
Well then try like:
=if(DateExport=$(=lastExport), Catégorie)
Note, an additional '=' sign before the variable name. This should work if there is SINGLE Catégorie against your max date.
Sorry for the confusion, in my code there is no Typo, ExportDate everywhere, and with the results I described in my original post
well then I would say to inspect the following
what is the value in the variable lastExport
and the value in the dimesion ExportDate
are they both in the same format?
No doesn't work like this either, "Error in calculated dimension"