Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can some one help please ?
I have a table
Id | Char | No |
1 | A | 4 |
2 | B | 3 |
3 | C | |
4 | C | |
5 | C | 2 |
6 | D | |
7 | D | 1 |
Requirement:
Char C has No 2 in one of the rows.
I want to fill the rest of the Cs with the same value.
Same with D it has 1 so the rest of the occurrences of D must have No as 1 also
(the Nos can be different so I cannot do update no='2' where Char=C )
How can I fill the columns ?
Hi
is it just happinstance that the no is given with the highest ID for a char?
If you can retrieve the data in different sequence you could "lookup" the previous value of No with peek()
Maybe you can do a reorder once loaded into QV based on your business rules for the No field?
Regards
Jürg
Assuming that every Char has a No and there is only one No for every Char
Load Id and Char into one table and Char and No into another, but exclude the empty No. you'll get something like:
TableA:
Id | Char |
1 | A |
2 | B |
3 | C |
4 | C |
5 | C |
6 | D |
7 | D |
TableB:
Char | No |
A | 4 |
B | 3 |
C | 2 |
D | 1 |
This should be it, but if you like you can join the two tables back together again
Hi thanks for the reply , but that is not the case it is not the highest value it can be any value
Hi Quwok,
Thanks fo the resoponse, but my requiremtent is to fill the values in the orignal table
If you left joined Table B to Table A, you'll get
Id | Char | No |
1 | A | 4 |
2 | B | 3 |
3 | C | 2 |
4 | C | 2 |
5 | C | 2 |
6 | D | 1 |
7 | D | 1 |
or am i missing something here?
Hi
I think you need to show a more complete example. You say a Char can have different No values. What is the rule for assigning the values to the Char? Do you want the latest given No in order of the ID applied to the preceeding Chars?
Regards
Juerg
first u fetch the table than transform the table fill blank value with below figure
Regards
Ashish
qvw file
How do you left join a tab, that is in QlikView
i mean, i have one table as shown at the top, i can create the secnd table, using resident tables.
but thn how will i left join tab2 with tab1 ??