Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
HELO
CreationDate | Stan |
2020-09-17 23:59:12 | |
2020-09-18 00:00:12 | |
2020-09-18 00:01:12 | |
2020-09-18 00:02:12 | |
2020-09-18 00:03:12 | |
2020-09-18 00:04:12 | |
2020-09-18 00:05:12 | |
2020-09-18 00:06:12 | |
2020-09-18 00:07:12 | A |
2020-09-18 00:07:12 | |
2020-09-18 00:08:12 | |
2020-09-18 00:09:12 | |
2020-09-18 00:10:12 | B |
2020-09-18 00:10:12 | |
2020-09-18 00:11:12 | |
2020-09-18 00:12:12 | |
2020-09-18 00:13:12 | |
2020-09-18 00:14:12 | |
2020-09-18 00:15:12 | C |
2020-09-18 00:15:12 | |
2020-09-18 00:16:12 | |
2020-09-18 00:17:12 | |
2020-09-18 00:18:12 | D |
2020-09-18 00:18:12 |
How to fill in empty fields in a table with an earlier value. I suppose you have to use the privus function.
But how ???
Hi, I've already answered a very similar question here: https://community.qlik.com/t5/New-to-QlikView/Creating-a-master-calendar-and-filling-in-missing-data...
You can use Peek() or Previous() to retrieve the value of the previous record, and use a sorted load to load them by date ("Order by CreationDate" or "Order By CreationDate desc" depending if you want to propagate them forwards or backwards, something like:
Outer Join (Temp)
LOAD CreationDate Resident MasterCalendar;
TempFilled:
LOAD CreationDate,
If(IsNull(Stan), Peek(Stan), Stan) as StanRICE
Resident Temp
Order By CreationDate;
DROP Table Temp;
After adding the code and reloading, I saw a view of duplicate values. There are still empty values in the columns StanRICE
@Tooomooo It may be most helpful if you can attach a QVW we can look at directly and tweak and reattach at this point to ensure you get the right solution. @rubenmarin can you have a second look just to see if you may be able to sort something without the QVW file?
Cheers,
Brett
Hi @Tooomooo @Brett_Bleess , probably it needs to be
If(IsNull(Stan), Peek(StanRICE), Stan) as StanRICE
can you try this?
if(len(trim(StanRICE))=0,Peek('StanRICE'),StanRICE) as StanRICE
or
Use Previous function:
IF(LEN(StanRICE)=0,PREVIOUS(StanRICE),StanRICE) AS StanRICE