Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
madhubabum
Creator
Creator

Add fields dynamically to the expression

Hello Experts,

I am having one scenario,.

I am using Ad hoc report in Qliksense by using multiple dimensions and multiple expressions.

Base expression is : Sum(sales)/ Sum(Total Sales).

Here if i'm adding region has dimension, Expression should like  - sum(sales)/sum(Total<Region> Sales)

If i included one more dimension , expression should like - sum(sales)/sum(Total<Region,Area>sales)

Means, if i selected any dimension it is going to add or remove from denominator after total qualifier.

Any suggestions ?

Thanks in Advance.

Regards,

Madhu

Labels (2)
5 Replies
Anil_Babu_Samineni

As you said, you are using Adhoc repot. for that, Perhaps this?

If(GetSelectedCount(Dimension)=0, Sum(sales)/ Sum(Total Sales),  Sum(sales)/ Sum(Total <$(=Concat(DISTINCT Dimension, ','))> Sales))

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
madhubabum
Creator
Creator
Author

Hi Anil,

Thanks for your reply. But i am getting null values in the expression.

Regards,

Madhu

Anil_Babu_Samineni

Please replace the Dimension field with input field?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
madhubabum
Creator
Creator
Author

Anil - I want to add / remove fields dynamically from selected dimension values.

           With input filed i'm not able to get the expected result.(Measure is not going to calculate - Giving null values).

          is there any solution with Substringcount(Concat())  - ?

 

Thanks in Advance

Anil_Babu_Samineni

Should be possible

=SubStringCount('|' & $(=Concat(distinct Dimension, '|')) & '|', '|Measure1|')

TRy this in Text object and see?

$(=Concat(distinct Dimension, '|'))

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)