Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
mrichman
Creator II
Creator II

How to show value on the same row?

Hi Guys,

Would be nice if you could help me out. How can I show value on the same row?

I have two tables, Table 1 and Table 2 on the backend. On the front end I have a filter on "Level" (see underlying picture)

On the front end I selected Level = A, and Type = Bad ----- This should show a ranking lower than A. So in this case, 2 which is equal to B.

My current if statement is working for 'Good' but for 'Bad' I cant find the right solution. I'm getting ranking 2 and would like to show B.

My current statement is the underlying, I tried playing with variables to get the B but it is not working.

IF(Type='Good',[Level],IF(Type='Bad',Rank+1)) as Test

Community Question.PNG

Do you guys have any idea?

Thanks in advance.

1 Solution

Accepted Solutions
OmarBenSalem
Partner
Partner

Try this :

If(Type='Good',Level,

If(Type='Bad',only({1<Rank={"$(=max(Rank)+1)"}>}Level)))

Result:

Capture.PNG

to show it on the same table; please alter it as follow:

If(Type='Good',Level,

If(Type='Bad',only(total {1<Rank={"$(=max(Rank)+1)"}>}Level)))

Result:

c.PNG

View solution in original post

9 Replies
qlikmeplease
Creator III
Creator III

Just change table 1 to reflect something like this:

Type      Level

Good      A

Bad         B

Bad         C

Bad         D

Bad         E

Bad         F

mrichman
Creator II
Creator II
Author

Hi Ruan,

Thanks for your prompt reply. This is not possible. Because if the next selection would be Level=C and Type is Bad, then it should show D.

It needs to be dynamic.

Thanks in advance.

undergrinder
Specialist II
Specialist II

Hi Migual,

so the logic is only the selected level is good, and any other value is bad?

I don't really get what is the requirement.

G.

mrichman
Creator II
Creator II
Author

Hi Gabor,

Thanks for you message the logic should be the following.

If ..... Level is A and Type is Good then show the same as Level, in this case A.

the other part is.

If..... Level is A and Type is Bad then show one Level lower than current selected, in this case B.

So.

Level                Type                Answer

Good                    A                    A

Good                    B                    B

Good                     C                    C

.....

Bad                         A                   B

Bad                        B                   C

Bad                        C                   D

....

Hope this helps

Thanks in advance.

OmarBenSalem
Partner
Partner

Can u share mock table with maybe 10 rows so that I can perform test on it ?

mrichman
Creator II
Creator II
Author

Added one

qlikmeplease
Creator III
Creator III

Well, Because there are so little number of rows

Id suggest creating another column in the Table2 called BadType

Resulting table

Rank     Type  BadType

1           A          B

2           B          C         

3           C          D

4           D          E

5           E          F

6           F          G

And change your formula to IF(Type = 'Good',[Type],[BadType])

OmarBenSalem
Partner
Partner

Try this :

If(Type='Good',Level,

If(Type='Bad',only({1<Rank={"$(=max(Rank)+1)"}>}Level)))

Result:

Capture.PNG

to show it on the same table; please alter it as follow:

If(Type='Good',Level,

If(Type='Bad',only(total {1<Rank={"$(=max(Rank)+1)"}>}Level)))

Result:

c.PNG

View solution in original post

mrichman
Creator II
Creator II
Author

Awesome! it worked!!! Thanks!