Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello
I have a series of measure that have the following format
KPI_A.Monthly
KPI_A.Target
KPI_A.Accumulative
KPI_A.EOY
KPI_B.Monthly
KPI_B.Target
KPI_B.Accumulative
KPI_B.EOY
KPI_C.Monthly
… etc …
I also have a table with the root name of the measures
KPI_Key
KPI_A
KPI_B
KPI_C
…
1) 1st Method
If I inject this table inside a variable (KPI_Analyzed_Key), I can (with a drop-down selector) select a KPI_Analyzed_Key and then display all the associated measure using this expression:
[$(KPI_Analyzed_Key).Monthly]
And it works perfectly, I’ve got the monthly value for the selected KPI
2) 2nd Method
Using the same approach, I want to display all my measure in the same table… I would like to have something like that
KPI_Key | Monthly | Target | Accumulative | EOY |
KPI_A | ||||
KPI_B | ||||
KPI_C |
However, I cannot manage to get it …
I’ve tried to duplicate the same formula as previously:
[$(KPI _Key).Monthly]
but its not working.
Any clue ?
@JuMo You are trying to evaluate multiple master measure for each value of KPI which is not possible as measure is evaluated once for each value. If you want to evaluate different measure for each dimension value you will need something like pick (match(
With KPI_key as dimension you can create below measures.
Monthly: //Measure 1
=pick(Match(KPI_key,'KPI_A','KPI_B','KPI_C'),
[KPI_A.Monthly],[KPI_B.Monthly],[KPI_C.Monthly])
Target: // Measure 2
=pick(Match(KPI_key,'KPI_A','KPI_B','KPI_C'),
[KPI_A.Target],[KPI_B.Target],[KPI_C.Target])
EOY: //Measure 3
=pick(Match(KPI_key,'KPI_A','KPI_B','KPI_C'),
[KPI_A.EOY],[KPI_B.EOY],[KPI_C.EOY])
Hi - When you say 'Using the same approach,..' whats the approach, could you provide the expression/code for that so we cn repeat the same and check if that works for the second case too?
Well the variable apporach was simple:
- There is a variable called KPI_Analyzed_Key
- There is a variable input drop down populated by my table/column KPI_Key and the value is saved in the variable KPI_Analyzed_Key
- To display a measure according to the selected variable, I use the following expression
[$(KPI_Analyzed_Key).Monthly]
And surprisingly, it works
Hi @JuMo
variable always holds single value at the time. So if you expect it to expand to different values for each row of your table - it will not work. Instead you may want to consider using function like Only() or MaxString() to pickup the value from the dim.
Something like: [$(=Only(KPI _Key)).Monthly]
I would then preview how this expands in expression editor
cheers
Thanks .... The dollar sign seams to give an incorrect result, he is my result
KPI_Key | Only(KPI_Key) | $(=Only(KPI_Key)) | [$(=Only(KPI_Key)).Monthly] |
KPI_A | KPI_A | - | - |
KPI_B | KPI_B | - | - |
KPI_C | KPI_C | - | - |
Hi @JuMo,
Try using the GetObjectField() Function, it should return the KPI-Key from each row, if you write it as a $-Sign expression.
So using something like [$(=GetObjectField(0)).Monthly] might work.
whats your expected output?
something like this:
Thanks for your help, however, it's not working:
[$(=GetObjectField(0)).Monthly] returns "-"
KPI_Key | [$(=GetObjectField(0)).Monthly] |
KPI_A | - |
KPI_B | - |
KPI_C; | - |
$(=GetObjectField(0)) returns a string with the KPI key
KPI_Key | $(=GetObjectField(0)) |
KPI_A | KPI_A |
KPI_B | KPI_B |
KPI_C; | KPI_C |
GetObjectField(0) returns the name of the dimention
KPI_Key | GetObjectField(0) |
KPI_A | KPI_Key |
KPI_B | KPI_Key |
KPI_C; | KPI_Key |
Yes, exactly
Hi @JuMo
Can you create simple Ctrl + 00 app ( just create new app and hit CTRL + 00 on keyboard in load script). That will autogenerate script for testing. Use this data to replicate sample you are trying to do then post it here.
With actual app will be much quicker than going back and forth.
cheers