Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to create a bar chart with a tricky dimension.
My dimension constists of months (duration), but on the 1st bar I need everything (all months), on the 2nd bar I need all month >=1 (including 2,3, ... month), on the 3rd bar I need all month >=2 (incl. 3,4,6,12 ...), then >= 3, >= 6 and >=12 months.
The problem is, I cannot use "if (month >=1, then ...) because I wont get the values >2 in the next if.
Tha stacks on the bar a the sum(Standard), sum(non standard) and sum(other), but how can I create the dimension? I treid the script and dynamic dimension, but nothing worked.
Enclosed you will find the start-application
Thanks in advanced
Ok, I hope this is what you really need. See the attached file.
I used the initial if statement as a temporary dimension to create the actual dimension with an inline table
Hope that can be a start for you!
Regards,
Jakob
Hi there,
you could try creating an dimension in your script that classifies "duration_months" into your needed dimensions. That would make things a lot easier to display as you could use it as an actual dimension.
Add Something like in your script:
if(duration_months>=0, 'All',
if(duration_months>=1, '>=1 Months',
if(duration_months>=3, '>=3 Months',
if(duration_months>=6, '>=6 Months',
if(duration_months>=12, '>=12 Months' ))))) as Dimension_duration_months
Then use your new dimension and set analysis in your chart such as:
sum({$<duration_months={'>=3'}>}Value)
Your values should then be put into the correct dimensions.
Regards,
Jakob
thanks but I dont think this will work. I already tried this to learn, tha the first if-statement concludes all, but the second if never happens, because the first if already has everything.
If >= 0, then everything will be included, so the second if >=1 never happens.
I put in the script into the application.
Best Thanks Jakob, to reverse the statement will also not work.
to reverse the if-statements will result:
month 12 up to X
month 6 up to 11
month 3 up to 5
month 1 up to 2
But I need
month 12 up to x
month 6 up to X
month 3 up to X
month 1 up to X
Sorry, I just saw that too. I will have another look and try to get back to you with a better idea if I come up with one.
Ok, I hope this is what you really need. See the attached file.
I used the initial if statement as a temporary dimension to create the actual dimension with an inline table
Hope that can be a start for you!
Regards,
Jakob
Thanks a lot, this looks really good.
This is it.!