Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with showing data based on data entry (input box)

Hi i have a question,

i want to show the data based on user entry, i want to show all data if user doesnt input any data. When user input the data, it will show the data based on the entry.

I'm using this expression

if($(=len(percenFrom))=0 or $(=len(percenTo))=0,'A', 'B')

it works perfectly, but when i change the result A and B to another 'if condition' it doesnt show any data when im not enter the data. but when i enter the data it works perfectly.

Really appreciate your help, thanks

14 Replies
sunny_talwar

May be you need to check your second if condition if the one you have posted here is working as expected. Can you share the complete expression here?

Not applicable
Author

=if($(=len(percenFrom))=0 or$(=len(percenTo))=0,

  if(IsNull(vYear)

  if(isnull(vWeek),

  Sum({$<TRX={1}>} QTY),

  Sum({$<TRX={1}, YearWeek={$(vWeek)}>} QTY) 

  ),

  if(isnull(vWeek),

  Sum({$<TRX={121}, Year={$(vYear)}>} QTY)  ,

  Sum({$<TRX={121}, YearWeek={$(vWeek)}, Year={$(vYear)}>} QTY) 

  )

  ),

  .....

  .....

)

the first condition will show all data if user doesnt entry the input box (percenfrom/percento)

sunny_talwar

Not sure if this is the exact expression copy pasted from source or if it is just a typo, but a comma seems to be missing. See if that helps.

Indra Setiana wrote:

=if($(=len(percenFrom))=0 or$(=len(percenTo))=0,

  if(IsNull(vYear) //Comma missing here

  if(isnull(vWeek),

  Sum({$<TRX={1}>} QTY),

  Sum({$<TRX={1}, YearWeek={$(vWeek)}>} QTY)

  ),

  if(isnull(vWeek),

  Sum({$<TRX={121}, Year={$(vYear)}>} QTY)  ,

  Sum({$<TRX={121}, YearWeek={$(vWeek)}, Year={$(vYear)}>} QTY)

  )

  ),

  .....

  .....

)

the first condition will show all data if user doesnt entry the input box (percenfrom/percento)

Not applicable
Author

Dear Sunny,

oops sorry, it's just a typo, the source expression has comma, but it still not working,

Do you have any idea, confuse about it.

sunny_talwar

Try this may be:

if($(=len(percenFrom))=0 or$(=len(percenTo))=0,

  if(Len(Trim(vYear)) = 0,

  if(Len(Trim(vWeek)) = 0,

  Sum({$<TRX={1}>} QTY),

  Sum({$<TRX={1}, YearWeek={"$(vWeek)"}>} QTY)

  ),

  if(Len(Trim(vWeek)) = 0,

  Sum({$<TRX={121}, Year={"$(vYear)"}>} QTY)  ,

  Sum({$<TRX={121}, YearWeek={"$(vWeek)"}, Year={"$(vYear)"}>} QTY))),

Not applicable
Author

Dear Sunny,

Thanks for your response Sunny, but it still not working

do you have another idea ?

thanks

sunny_talwar

Can you test if individually each of the expression is working or not. These

1) Sum({$<TRX={1}>} QTY)

2) Sum({$<TRX={1}, YearWeek={"$(vWeek)"}>} QTY)

3) Sum({$<TRX={121}, Year={"$(vYear)"}>} QTY)

4) Sum({$<TRX={121}, YearWeek={"$(vWeek)"}, Year={"$(vYear)"}>} QTY)

Not applicable
Author

Hi Sunny,

all of the statement works perfectly Sunny, no problem with the statement.

sasiparupudi1
Master III
Master III

please try  the following expressions ina text object and see if they return  any values

A

if(IsNull(vYear)and isnull(vWeek),Sum({$<TRX={1}>} QTY),if(IsNull(vYear)and not isnull(vWeek),Sum({$<TRX={1}, YearWeek={$(vWeek)}>} QTY) ,0)

B

if(isnull(vWeek),

  Sum({$<TRX={121}, Year={$(vYear)}>} QTY)  ,

  Sum({$<TRX={121}, YearWeek={$(vWeek)}, Year={$(vYear)}>} QTY)

hth

Sasi